package io.dy.controller;

import io.dy.template.ExcelAndPdfExportTemplate;
import io.dy.template.impl.Demo02ExportImpl;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : dmj
 * @date: 2024/7/15 10:22 上午
 * @description:
 */
@RestController
@RequestMapping("/io/dy")
@RequiredArgsConstructor
public class DemoExportController {

    private final Demo02ExportImpl export;

    @GetMapping("/export/{id}")
    public void exportSummaryPdf(@PathVariable Long id, HttpServletResponse response, HttpServletRequest httpServletRequest) {
        export.export(response, httpServletRequest, id);
    }
}
